// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_HR_CAR_RENTING
// * CreateDate    : 2014-06-05 18:30:03
// * Creater       : CodeSmith
// * LastChangeDate: 2014-06-05 18:30:03
// * LastChanger   : 2014-06-05 18:30:03
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;
using ESOL.Common;

namespace ESOL.Common.Entity
{
    [DataContract]
	[Serializable]
	public partial class HrCarRentingEntity : EntityBase
    {
        public HrCarRentingTable TableSchema
        {
            get
            {
                return HrCarRentingTable.Current;
            }
		}
		
		public HrCarRentingEntity()
        {

        }
		
		public HrCarRentingEntity(DataRow dr)
        {
			if(dr == null)
			{
				return;
			}
			this.RentingId = Convert.ToString(CommonFunctions.ToObject(dr["RENTING_ID"]));
			this.DepartmentId = Convert.ToString(CommonFunctions.ToObject(dr["DEPARTMENT_ID"]));
			this.PersonId = Convert.ToString(CommonFunctions.ToObject(dr["PERSON_ID"]));
			this.PersonCount = Convert.ToInt32(CommonFunctions.ToObject(dr["PERSON_COUNT"]));
			this.RentingReason = Convert.ToString(CommonFunctions.ToObject(dr["RENTING_REASON"]));
			this.Destination = Convert.ToString(CommonFunctions.ToObject(dr["DESTINATION"]));
			this.CarNo = Convert.ToString(CommonFunctions.ToObject(dr["CAR_NO"]));
			this.StartDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["START_DATE"]));
			this.EndDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["END_DATE"]));
			this.StartMileage = Convert.ToDecimal(CommonFunctions.ToObject(dr["START_MILEAGE"]));
			this.EndMileage = Convert.ToDecimal(CommonFunctions.ToObject(dr["END_MILEAGE"]));
			this.ApproveRemark = Convert.ToString(CommonFunctions.ToObject(dr["APPROVE_REMARK"]));
			this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
			this.CreatedBy = Convert.ToString(CommonFunctions.ToObject(dr["CREATED_BY"]));
			this.CreatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["CREATED_DATE"]));
			this.LastModifiedBy = Convert.ToString(CommonFunctions.ToObject(dr["LAST_MODIFIED_BY"]));
			this.LastModifiedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["LAST_MODIFIED_DATE"]));
			this.ApprovedBy = Convert.ToString(CommonFunctions.ToObject(dr["APPROVED_BY"]));
			this.ApprovedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["APPROVED_DATE"]));
			this.Status = Convert.ToString(CommonFunctions.ToObject(dr["STATUS"]));
        }
		
		public HrCarRentingEntity(DataRowView dr)
        {
			if(dr == null)
			{
				return;
			}
			this.RentingId = Convert.ToString(CommonFunctions.ToObject(dr["RENTING_ID"]));
			this.DepartmentId = Convert.ToString(CommonFunctions.ToObject(dr["DEPARTMENT_ID"]));
			this.PersonId = Convert.ToString(CommonFunctions.ToObject(dr["PERSON_ID"]));
			this.PersonCount = Convert.ToInt32(CommonFunctions.ToObject(dr["PERSON_COUNT"]));
			this.RentingReason = Convert.ToString(CommonFunctions.ToObject(dr["RENTING_REASON"]));
			this.Destination = Convert.ToString(CommonFunctions.ToObject(dr["DESTINATION"]));
			this.CarNo = Convert.ToString(CommonFunctions.ToObject(dr["CAR_NO"]));
			this.StartDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["START_DATE"]));
			this.EndDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["END_DATE"]));
			this.StartMileage = Convert.ToDecimal(CommonFunctions.ToObject(dr["START_MILEAGE"]));
			this.EndMileage = Convert.ToDecimal(CommonFunctions.ToObject(dr["END_MILEAGE"]));
			this.ApproveRemark = Convert.ToString(CommonFunctions.ToObject(dr["APPROVE_REMARK"]));
			this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
			this.CreatedBy = Convert.ToString(CommonFunctions.ToObject(dr["CREATED_BY"]));
			this.CreatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["CREATED_DATE"]));
			this.LastModifiedBy = Convert.ToString(CommonFunctions.ToObject(dr["LAST_MODIFIED_BY"]));
			this.LastModifiedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["LAST_MODIFIED_DATE"]));
			this.ApprovedBy = Convert.ToString(CommonFunctions.ToObject(dr["APPROVED_BY"]));
			this.ApprovedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["APPROVED_DATE"]));
			this.Status = Convert.ToString(CommonFunctions.ToObject(dr["STATUS"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return HrCarRentingTable.Current;
            }
        }
		
		#region Perporty List
        [DataMember]
        public string RentingId
        {
            get { return Convert.ToString(GetData(HrCarRentingTable.C_RENTING_ID)); }
            set { SetData(HrCarRentingTable.C_RENTING_ID, value); }
        }
		
        [DataMember]
        public string DepartmentId
        {
            get { return Convert.ToString(GetData(HrCarRentingTable.C_DEPARTMENT_ID)); }
            set { SetData(HrCarRentingTable.C_DEPARTMENT_ID, value); }
        }
		
        [DataMember]
        public string PersonId
        {
            get { return Convert.ToString(GetData(HrCarRentingTable.C_PERSON_ID)); }
            set { SetData(HrCarRentingTable.C_PERSON_ID, value); }
        }
		
        [DataMember]
        public int PersonCount
        {
            get { return Convert.ToInt32(GetData(HrCarRentingTable.C_PERSON_COUNT)); }
            set { SetData(HrCarRentingTable.C_PERSON_COUNT, value); }
        }
		
        [DataMember]
        public string RentingReason
        {
            get { return Convert.ToString(GetData(HrCarRentingTable.C_RENTING_REASON)); }
            set { SetData(HrCarRentingTable.C_RENTING_REASON, value); }
        }
		
        [DataMember]
        public string Destination
        {
            get { return Convert.ToString(GetData(HrCarRentingTable.C_DESTINATION)); }
            set { SetData(HrCarRentingTable.C_DESTINATION, value); }
        }
		
        [DataMember]
        public string CarNo
        {
            get { return Convert.ToString(GetData(HrCarRentingTable.C_CAR_NO)); }
            set { SetData(HrCarRentingTable.C_CAR_NO, value); }
        }
		
        [DataMember]
        public DateTime StartDate
        {
            get { return Convert.ToDateTime(GetData(HrCarRentingTable.C_START_DATE)); }
            set { SetData(HrCarRentingTable.C_START_DATE, value); }
        }
		
        [DataMember]
        public DateTime EndDate
        {
            get { return Convert.ToDateTime(GetData(HrCarRentingTable.C_END_DATE)); }
            set { SetData(HrCarRentingTable.C_END_DATE, value); }
        }
		
        [DataMember]
        public decimal StartMileage
        {
            get { return Convert.ToDecimal(GetData(HrCarRentingTable.C_START_MILEAGE)); }
            set { SetData(HrCarRentingTable.C_START_MILEAGE, value); }
        }
		
        [DataMember]
        public decimal EndMileage
        {
            get { return Convert.ToDecimal(GetData(HrCarRentingTable.C_END_MILEAGE)); }
            set { SetData(HrCarRentingTable.C_END_MILEAGE, value); }
        }
		
        [DataMember]
        public string ApproveRemark
        {
            get { return Convert.ToString(GetData(HrCarRentingTable.C_APPROVE_REMARK)); }
            set { SetData(HrCarRentingTable.C_APPROVE_REMARK, value); }
        }
		
        [DataMember]
        public string Remark
        {
            get { return Convert.ToString(GetData(HrCarRentingTable.C_REMARK)); }
            set { SetData(HrCarRentingTable.C_REMARK, value); }
        }
		
        [DataMember]
        public string CreatedBy
        {
            get { return Convert.ToString(GetData(HrCarRentingTable.C_CREATED_BY)); }
            set { SetData(HrCarRentingTable.C_CREATED_BY, value); }
        }
		
        [DataMember]
        public DateTime CreatedDate
        {
            get { return Convert.ToDateTime(GetData(HrCarRentingTable.C_CREATED_DATE)); }
            set { SetData(HrCarRentingTable.C_CREATED_DATE, value); }
        }
		
        [DataMember]
        public string LastModifiedBy
        {
            get { return Convert.ToString(GetData(HrCarRentingTable.C_LAST_MODIFIED_BY)); }
            set { SetData(HrCarRentingTable.C_LAST_MODIFIED_BY, value); }
        }
		
        [DataMember]
        public DateTime LastModifiedDate
        {
            get { return Convert.ToDateTime(GetData(HrCarRentingTable.C_LAST_MODIFIED_DATE)); }
            set { SetData(HrCarRentingTable.C_LAST_MODIFIED_DATE, value); }
        }
		
        [DataMember]
        public string ApprovedBy
        {
            get { return Convert.ToString(GetData(HrCarRentingTable.C_APPROVED_BY)); }
            set { SetData(HrCarRentingTable.C_APPROVED_BY, value); }
        }
		
        [DataMember]
        public DateTime ApprovedDate
        {
            get { return Convert.ToDateTime(GetData(HrCarRentingTable.C_APPROVED_DATE)); }
            set { SetData(HrCarRentingTable.C_APPROVED_DATE, value); }
        }
		
        [DataMember]
        public string Status
        {
            get { return Convert.ToString(GetData(HrCarRentingTable.C_STATUS)); }
            set { SetData(HrCarRentingTable.C_STATUS, value); }
        }
		
		#endregion
	}
	
	
}	

